package com.zjitc.backend_shop.pojo;

import com.alibaba.fastjson.annotation.JSONField;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import tk.mybatis.mapper.annotation.KeySql;

import javax.persistence.Id;
import javax.persistence.Table;

/**
*   @author 王新瑜
*   @date 2024/12/17 15:37
*/

@Data
@Table(name = "vueshop_admin")
@AllArgsConstructor
@NoArgsConstructor
@Schema(description = "管理员实体类")
public class Admin {
    @Id
    // 主键回填
    @KeySql(useGeneratedKeys = true)
    // 编号, 主键
    @Schema(description = "编号")
    private Integer id;

    // 用户名
    @Schema(description = "用户名")
    private String username;

    // 密码
    @Schema(description = "密码")
    @JSONField(serialize = false)
    private String password;

    // 盐, 用于MD5加密
    @Schema(description = "盐")
    private String salt;

    // 头像
    @Schema(description = "头像")
    private String avatar;
    //数据权限
    @Schema(description = "数据权限")
    private String permission;
    //显示顺序
    @Schema(description = "显示顺序")
    private Integer sort;
    //角色状态
    @Schema(description = "角色状态")
    private Boolean state;
}
